package ch.sfug.events {
	import flash.events.Event;
	import flash.geom.Rectangle;	
	public class StreamMetaEvent extends Event {

		public static const META:String = "stream_meta";
		private var _info:Object;

		public function StreamMetaEvent( type:String, info:Object, bubbles:Boolean = false, cancelable:Boolean = false ) {
			super(type, bubbles, cancelable);
			_info = info;
		}

		
		/**
		 * Creates and returns a copy of the current instance.
		 * @return a copy of the current instance.
		 */
		public override function clone():Event {
			return new StreamMetaEvent(type, bubbles, cancelable);
		}

		
		public function get duration():Number {
			return _info.duration;
		}

		
		public function get size():Rectangle {
			return new Rectangle(0, 0, _info.width, _info.height);
		}

		
		public function get metaObject():Object {
			return _info;
		}
		
		override public function toString() : String {
			var obj:String = "";
			for (var i:String in _info ) {
				obj += ( i + ":" + _info[ i ] + ", " );
			}
			return "StreamMetaEvent: " + obj;
		}
	}
}